#include<bits/stdc++.h>
using namespace std;
int n,l=0;
long long k=0;
struct s{
    int n,m;
}w[100005];
bool cmp(s x,s y){
    if(x.n!=0&&y.n!=0){
           return x.m<y.m;
    }
    return x.n>y.n;
}
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        int x;
        cin>>x;
        w[x].n++;
        w[x].m=x;
    }
    l=n;
    sort(w+1,w+100005,cmp);
    for(int i=2;i<=n;i++){
        if(w[i].m==0)break;
        if(w[i].n>w[i-1].n){
            l-=w[i-1].n;
            if(k>0){
                if(w[i].n-w[i-1].n>=k){
                    l-=k;
                    k=0;
                }else{
                    k-=(w[i].n-w[i-1].n);
                    l-=(w[i].n-w[i-1].n);
                }
            }
        }else{
            k+=w[i-1].n-w[i].n;
            l-=w[i].n;
        }
        w[i-1].n=0;
    }
    cout<<l;
    return 0;
}
